The most efficient way to climb for most riders is by sitting in the saddle. This makes the best use of your gluteal muscles and places less stress on your breathing. Spinning a lower gear while seated will also keep your legs fresher for longer.
Get out of the saddle on a climb to add a short burst of speed or just to stretch the legs. It can also be useful to stand up on the pedals when the pitch of the hill gets a little steeper.
Use this technique sparingly though as it can use up far more energy than a seated effort and push your body into lactate overload.