A distributed optimal control problem for an extended model of phase field type for tumor growth is addressed. In this model, the chemotaxis effects are also taken into account. The control is realized by two control variables that design the dispensation of some drugs to the patient. The cost functional is of tracking type, whereas the potential setting has been kept quite general in order to allow regular and singular potentials to be considered. In this direction, some relaxation terms have been introduced in the system. We show the well-posedness of the state system, the Fréchet differentiability of the control-to-state operator in a suitable functional analytic framework, and, lastly, we characterize the first-order necessary condition...