On the origin of Uranus and Neptune magnetic fields