Study of extragalactic sources with H.E.S.S.