We present the results of three-dimensional simulations of quasar polarizations in the presence of pseudoscalar-photon mixing in the intergalactic medium. The intergalactic magnetic field is assumed to be uncorrelated in wave vector space but correlated in real space. Such a field may be obtained if its origin is primordial. Furthermore we assume that the quasars, located at cosmological distances, have negligible initial polarization. In the presence of pseudoscalar-photon mixing we show, through a direct comparison with observations, that this may explain the observed large scale alignments in quasar polarizations within the framework of big bang cosmology. We find that the simulation results give a reasonably good fit to the observed data.