Recent surveys have revealed that planets intermediate in size between Earth and Neptune (`super-Earths') are among the most common planets in the Galaxy. Atmospheric studies are the next step towards developing a comprehensive understanding of this new class of object. Much effort has been focused on using transmission spectroscopy to characterize the atmosphere of the super-Earth archetype GJ1214b (refs 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17), but previous observations did not have sufficient precision to distinguish between two interpretations for the atmosphere. The planet's atmosphere could be dominated by relatively heavy molecules, such as water (for example, a 100 per cent water vapour composition), or it could contain high-altitude clouds that obscure its lower layers. Here we report a measurement of the transmission spectrum of GJ1214b at near-infrared wavelengths that definitively resolves this ambiguity. The data, obtained with the Hubble Space Telescope, are sufficiently precise to detect absorption features from a high mean-molecular-mass atmosphere. The observed spectrum, however, is featureless. We rule out cloud-free atmospheric models with compositions dominated by water, methane, carbon monoxide, nitrogen or carbon dioxide at greater than 5σ confidence. The planet's atmosphere must contain clouds to be consistent with the data.