Relativistic Cosmology and Magnetogenesis