Enhancement of the photoassociation of ultracold atoms via a non-resonant magnetic field