Measuring the phase of a Bose-Einstein condensate