The aim of the present paper is to investigate a possible contribution of the rotation-powered pulsars and pulsar wind nebulae to the population of ultraluminous X-ray sources (ULXs). We first develop an analytical model for the evolution of the distribution function of pulsars over the spin period and find both the steady-state and the time-dependent solutions. Using the recent results on the X-ray efficiency dependence on pulsar characteristic age, we then compute the X-ray luminosity function (XLF) of rotation-powered pulsars. In a general case it has a broken power-law shape with a high luminosity cutoff, which depends on the distributions of the birth spin period and the magnetic field. Using the observed XLF of sources in the nearby galaxies and the condition that the pulsar XLF does not exceed that, we find the allowed region for the parameters describing the birth period distribution. We find that the mean pulsar period should be greater than 10-40 ms. These results are consistent with the constraints obtained from the X-ray luminosity of core-collapse supernovae. We estimate that the contribution of the rotation-powered pulsars to the ULX population is at a level exceeding 3 per cent. For a wide birth period distribution, this fraction grows with luminosity and above 10E40 erg/s pulsars can dominate the ULX population.