Observation of the W49B supernova remnant with Fermi-LAT and H.E.S.S.