Hot Jupiters are a class of extrasolar planet that orbit their parent stars at very short distances. They are expected to be tidally locked, which can lead to a large temperature difference between their daysides and nightsides. Infrared observations of eclipsing systems have yielded dayside temperatures for a number of transiting planets. The day-night contrast of the transiting extrasolar planet HD189733b was `mapped' using infrared observations. It is expected that the contrast between the daysides and nightsides of hot Jupiters is much higher at visual wavelengths, shorter than that of the peak emission, and could be further enhanced by reflected stellar light. Here we report the analysis of optical photometric data obtained over 36 planetary orbits of the transiting hot Jupiter CoRoT-1b. The data are consistent with the nightside hemisphere of the planet being entirely black, with the dayside flux dominating the optical phase curve. This means that at optical wavelengths the planet's phase variation is just as we see it for the interior planets in the Solar System. The data allow for only a small fraction of reflected light, corresponding to a geometric albedo of <0.20.