Polystyrene spheres are used to template TiO2 with a single layer of 300 nm wells which are infilled with PbS quantum dots to form a heterojunction solar cell. The porous well device has an efficiency of 5.7% while the simple planar junction is limited to 3.2%. Using a combination of optical absorption and photocurrent transient decay measurement we determined that the performance enhancement comes from a combination of enhanced optical absorption and increased carrier lifetime.