The impact of magnetic fields on the IMF in star-forming clouds near a supermassive black hole