A Bose-Einstein condensate optical 'transistor'