Critical velocity for vortex shedding in a Bose-Einstein condensate