We analyze the optical-near infrared spectra of 33 quasars with redshifts 3.9 ≤ z ≤ 6.4 to investigate the properties of dust extinction at these cosmic epochs. The SMC extinction curve has been shown to reproduce the dust reddening of most quasars at z < 2.2; we investigate whether this curve also provides a good description of dust extinction at higher redshifts. We fit the observed spectra with synthetic absorbed quasar templates obtained by varying the intrinsic slope (α λ ), the absolute extinction (A 3000 ), and by using a grid of empirical and theoretical extinction curves. We find that seven quasars in our sample are affected by substantial extinction (A 3000 ≥ 0.8), and characterized by very steep intrinsic slopes (α λ ≤ −2.3). All of the individual quasars require extinction curve deviating from that of the SMC, with a tendency to flatten at λ ≤ 2000 Å (in the rest frame of the source). However, due to the uncertainties in the individual extinction curves the SMC is still (marginally) consistent with the data in most cases. We obtain a mean extinction curve at z > 4, both by performing a simultaneous fit of all quasars and by averaging the extinction curves inferred for individual quasars. In the case of broad absorption line quasars (which are generally more absorbed by dust and possibly in a younger evolutionary stage), the mean extinction curve deviates from the SMC at a confidence level ≥95%. The difference between extinction curves in quasars at z > 4 and in quasars at lower redshift is indicative of either a different dust production mechanism at high redshift, or a different mechanism for processing dust into the ISM. We suggest that the same transitions may also apply to normal, star-forming galaxies at z > 4. In particular, the observed change in the average spectral slope of galaxies at z > 4 may be partially ascribed to a variation in the extinction curve, rather than a lower dust content at high redshift. In this scenario, the extinction curve inferred at z > 4 would imply a cosmic star-formation corrected for dust attenuation a factor of ∼2 higher than estimated in the past.