Magnetic confinement of massless Dirac fermions in graphene