Context. Solar wind electron velocity distribution functions (VDFs) show enhanced levels of suprathermal electrons as compared to a Maxwellian distribution. Previous studies show that the suprathermal tails of solar wind VDFs can be fitted by kappa distributions, and that a coronal origin of the suprathermal electrons is possible. Aims. The generation of suprathermal electrons by resonant interaction with whistler waves in the corona is investigated under quiet solar conditions without any flare activity. The magnetic field geometry is that of a closed magnetic loop. The electron-whistler interaction is described within the framework of quasilinear theory, that leads to pitch-angle diffusion of the electrons in the reference frame of the waves. Methods. A study of electron VDFs requires a kinetic description of the electrons. The model used in this paper is based on a numerical solution of the Boltzmann-Vlasov equation for the electrons, considering Coulomb collisions and wave-electron interaction. The waves are assumed to enter the simulation box with a given power-law spectrum, which evolves inside the box due to wave propagation and absorption by the electrons. Starting from a nearly Maxwellian initial electron VDF, the temporal evolution of the VDF is calculated until a final steady state has been reached. Results. The results show that a population of suprathermal electrons develops in a closed coronal loop. The electron VDF can be approximated by a power-law in the energy range of 4-10 keV. The power-law index is in agreement with the solar wind observations. For lower energy, the electrons are thermalized in the dense model coronal loop, and the efficiency of the acceleration mechanism decreases for higher energies. The energy range of the simulation box has to be chosen sufficiently large, and the influence of the loop geometry on the results is also studied. Conclusions. These numerical studies show that the quiet solar corona is capable of producing suprathermal electron VDFs with similar characteristics to those observed in the solar wind. This study is focused on a closed region in the solar corona, but if such an electron population is present in the corona, it should also appear in the solar wind.