A quality control problem and quasi-variational inequalities