Magnetic structure and spin reorientation of the Mn ions in NdMnO3