Hybrid stars in a strong magnetic field