  The large-scale magnetic fields we observe today in galaxies and galaxy
clusters could be the result of a pure quantum effect taking place during
inflation, to wit, the creation of particles (photons) out from the vacuum in a
curved spacetime. We show that, whenever the conformal invariance of
electromagnetism is broken during inflation, the actual magnetic field
spectrum, in the classical limit, is given by $B_k \simeq k^2
\sqrt{n_{\mathbf{k}} }$, where $n_{\mathbf{k}} \gg 1$ is the number of created
photons with wavenumber $k$. In particular, a scale-invariant magnetic field of
order of $10^{12}$G can emerge in the simplest model of cosmic magnetogenesis,
the one where the inflaton is kinetically coupled to the photon. Moreover, and
contrarily to the general belief, we show that such a model is free from the
so-called strong-coupling and backreaction problems. This conclusion follows,
indirectly, from the observation that post-inflationary electric currents,
which in the literature are incorrectly supposed to freeze superhorizon
magnetic fields after inflation, are indeed vanishing on superhorizon scales
due to causality.

Cosmology and Nongalactic Astrophysics;General Relativity and Quantum Cosmology