Abstract The origin, propagation, and mechanisms of acceleration of the ultra-high energy cosmic rays (UHECRs) are not yet well understood. Aiming for a better interpretation of the available experimental data, these data have to be confronted with theoretical models. A realistic simulation of the propagation of UHECRs in the universe should take into account all the relevant energy loss processes due to the interaction with astrophysical backgrounds, as well as the intervening cosmic magnetic fields. Cosmological effects, such as the redshift dependence of the photon backgrounds and the adiabatic expansion of the universe, can play an important role in the aforementioned processes. Here we present results of simulations of the propagation of UHECR through the large scale structure of the universe considering cosmological and magnetic field effects simultaneously.