A quasar is thought to be powered by the infall of matter onto a supermassive black hole at the centre of a massive galaxy. Because the optical luminosity of quasars exceeds that of their host galaxy, disentangling the two components can be difficult. This led in the 1990s to the controversial claim of the discovery of `naked' quasars. Since then, the connection between quasars and galaxies has been well established. Here we report the discovery of a quasar lying at the edge of a gas cloud, whose size is comparable to that of a small galaxy, but whose spectrum shows no evidence for stars. The gas in the cloud is excited by the quasar itself. If a host galaxy is present, it is at least six times fainter than would normally be expected for such a bright quasar. The quasar is interacting dynamically with a neighbouring galaxy, whose gas might be feeding the black hole.