Interstellar dust plays a crucial role in the evolution of the Universe by assisting the formation of molecules, by triggering the formation of the first low-mass stars, and by absorbing stellar ultraviolet-optical light and subsequently re-emitting it at infrared/millimetre wavelengths. Dust is thought to be produced predominantly in the envelopes of evolved (age >1 Gyr), low-mass stars. This picture has, however, recently been brought into question by the discovery of large masses of dust in the host galaxies of quasars at redshift z > 6, when the age of the Universe was less than 1 Gyr. Theoretical studies, corroborated by observations of nearby supernova remnants, have suggested that supernovae provide a fast and efficient dust formation environment in the early Universe. Here we report infrared observations of a quasar at redshift 6.2, which are used to obtain directly its dust extinction curve. We then show that such a curve is in excellent agreement with supernova dust models. This result demonstrates a supernova origin for dust in this high-redshift quasar, from which we infer that most of the dust at high redshifts probably has the same origin.