Measurement of the B -> X-s gamma branching fraction and photon energy spectrum using the recoil method