Occupation of X-ray-selected galaxy groups by X-ray active galactic nuclei