Bose-Einstein condensation in the early universe is considered. The magnetic properties of a condensate of charged vector bosons are studied, showing that a ferromagnetic state is formed. As a consequence, the primeval plasma may be spontaneously magnetized inside macroscopically large domains and primordial magnetic fields can be generated.