We consider the inverse problem of determining an optical mask that produces a desired circuit pattern in photolithography. We set the problem as a shape design problem in which the unknown is a two-dimensional domain. The relationship between the target shape and the unknown is modeled through diffractive optics. We develop a variational formulation that is well-posed and propose an approximation that can be shown to have convergence properties. The approximate problem can serve as a foundation to numerical methods.