In this article we use optimal control to maximize the efficiency of a quantum heat engine executing the Otto cycle in the presence of external noise. We optimize the engine performance for both amplitude and phase noise. In the case of phase damping we additionally show that the ideal performance of a noiseless engine can be retrieved in the adiabatic (long time) limit. The results obtained here are useful in the quest for absolute zero, the design of quantum refrigerators that can cool a physical system to the lowest possible temperature. They can also be applied to the optimal control of a collection of classical harmonic oscillators sharing the same time-dependent frequency and subjected to similar noise mechanisms. Finally, our methodology can be used for the optimization of other interesting thermodynamic processes.