On the optimal control of some parabolic partial differential equation arising in economics