  The flux of ultra-high energy cosmic rays reaching Earth above the ankle
energy (5 EeV) can be described as a mixture of nuclei injected by
extragalactic sources with very hard spectra and a low rigidity cutoff.
Extragalactic magnetic fields existing between the Earth and the closest
sources can affect the observed CR spectrum by reducing the flux of
low-rigidity particles reaching Earth. We perform a combined fit of the
spectrum and distributions of depth of shower maximum measured with the Pierre
Auger Observatory including the effect of this magnetic horizon in the
propagation of UHECRs in the intergalactic space. We find that, within a
specific range of the various experimental and phenomenological systematics,
the magnetic horizon effect can be relevant for turbulent magnetic field
strengths in the local neighbourhood of order $B_{\rm rms}\simeq (50-100)\,{\rm
nG}\,(20\rm{Mpc}/{d_{\rm s})( 100\,\rm{kpc}/L_{\rm coh}})^{1/2}$, with $d_{\rm
s}$ the typical intersource separation and $L_{\rm coh}$ the magnetic field
coherence length. When this is the case, the inferred slope of the source
spectrum becomes softer and can be closer to the expectations of diffusive
shock acceleration, i.e., $\propto E^{-2}$. An additional cosmic-ray population
with higher source density and softer spectra, presumably also extragalactic
and dominating the cosmic-ray flux at EeV energies, is also required to
reproduce the overall spectrum and composition results for all energies down to
0.6~EeV.
