Stability of skyrmions on curved surfaces in the presence of a magnetic field