First-principles calculations of the magnetic and electronic structures of MnP under pressure