Chiral asymmetry and axial anomaly in magnetized relativistic matter