A two‐dimensional model describing equilibrium of a cracked inhomogeneous body with a rigid inclusion is studied. We assume that the Signorini condition, ensuring non‐penetration of the crack faces, is satisfied. For a family of corresponding variational problems, we analyze the dependence of their solutions on the location of the rigid inclusion. The existence of a solution of the optimal control problem is proven. For this problem, a cost functional is defined by an arbitrary continuous functional on a suitable Sobolev space, with the location parameter of the inclusion is chosen as a control parameter.