Analysis of an inverse problem arising in photolithography