Skyrmions in a magnetic field and π0 domain wall formation in dense nuclear matter