Effect of a magnetic field on energy transfer of band states to the Mn2+ 3d shell in the CdMgTe matrix with ultrathin CdMnTe layers