We study a spatial distribution of polyelectrolyte chains and counterions inside nanometer-size capsules by means of molecular dynamics simulation on the level of a colloidal model in which polyelectrolyte coils are modeled as soft charged spheres. The capsule shell is treated as a semipermeable membrane, impermeable for the polyelectrolyte chains, but allowing free diffusion of solvent molecules and counterions. As a result, counterions leak out from the capsule immersed into a fluid of low ionic strength. This counterion leakage leads to a formation of characteristic polyelectrolyte density profiles with the central plateau and large peaks at the wall. We show that a nonuniform distribution of the inner polyelectrolyte depends on the capsule radius, surface charge, concentration of encapsulated polyelectrolyte, and the volume fraction of capsules.