Composition of cosmic rays accelerated in active galactic nuclei