  We present a measurement of the extragalactic background light (EBL) based on
a joint likelihood analysis of 32 gamma-ray spectra for 12 blazars in the
redshift range z = 0.03 to 0.944, obtained by the MAGIC telescopes and
Fermi-LAT. The EBL is the part of the diffuse extragalactic radiation spanning
the ultraviolet, visible and infrared bands. Major contributors to the EBL are
the light emitted by stars through the history of the universe, and the
fraction of it which was absorbed by dust in galaxies and re-emitted at longer
wavelengths. The EBL can be studied indirectly through its effect on very-high
energy photons that are emitted by cosmic sources and absorbed via
photon-photon interactions during their propagation across cosmological
distances. We obtain estimates of the EBL density in good agreement with
state-of-the-art models of the EBL production and evolution. The 1-sigma upper
bounds, including systematic uncertainties, are between 13% and 23% above the
nominal EBL density in the models. No anomaly in the expected transparency of
the universe to gamma rays is observed in any range of optical depth.We also
perform a wavelength-resolved EBL determination, which results in a hint of an
excess of EBL in the 0.18 - 0.62 $\mu$m range relative to the studied models,
yet compatible with them within systematics.
