We analyze the most recent cosmological data, including Planck, taking into account the possible existence of a sterile neutrino with a mass at the eV scale indicated by short-baseline neutrino oscillations data in the 3+1 framework. We show that the contribution of local measurements of the Hubble constant induces an increase of the value of the effective number of relativistic degrees of freedom above the Standard Model value, giving an indication in favor of the existence of sterile neutrinos and their contribution to dark radiation. Furthermore, the measurements of the local galaxy cluster mass distribution favor the existence of sterile neutrinos with eV-scale masses, in agreement with short-baseline neutrino oscillations data. In this case there is no tension between cosmological and short-baseline neutrino oscillations data, but the contribution of the sterile neutrino to the effective number of relativistic degrees of freedom is likely to be smaller than one. Considering the Dodelson-Widrow and thermal models for the statistical cosmological distribution of sterile neutrinos, we found that in the Dodelson-Widrow model there is a slightly better compatibility between cosmological and short-baseline neutrino oscillations data and the required suppression of the production of sterile neutrinos in the early Universe is slightly smaller.