Quark matter in strong magnetic fields