Frustration, defined as a competition between interactions such that not all of them can be satisfied, is important in systems ranging from neural networks to structural glasses. Geometrical frustration, which arises from the topology of a well-ordered structure rather than from disorder, has recently become a topic of considerable interest. In particular, geometrical frustration among spins in magnetic materials can lead to exotic low-temperature states, including `spin ice', in which the local moments mimic the frustration of hydrogen ion positions in frozen water. Here we report an artificial geometrically frustrated magnet based on an array of lithographically fabricated single-domain ferromagnetic islands. The islands are arranged such that the dipole interactions create a two-dimensional analogue to spin ice. Images of the magnetic moments of individual elements in this correlated system allow us to study the local accommodation of frustration. We see both ice-like short-range correlations and an absence of long-range correlations, behaviour which is strikingly similar to the low-temperature state of spin ice. These results demonstrate that artificial frustrated magnets can provide an uncharted arena in which the physics of frustration can be directly visualized.