The concept of thermal machines has evolved from the canonical steam engine to the recently proposed nanoscopic quantum systems as working fluids. The latter obey quantum open system dynamics and frequently operate in nonequilibrium conditions. However, the role of this dynamics in the overall performance of quantum heat engines remains an open problem. Here we analyze and optimize the efficiency and power output of two-stage quantum heat engines fueled by nonequilibrium steady states. In a charging first stage, the quantum working fluid consisting of a qutrit or two coupled qubits is connected to two reservoirs at different temperatures, which establish a heat current that stores ergotropy in the system; the second stage comprises a coherent driving force that extracts work from the machine in finite a amount of time; finally, the external drive is switched off and the machine enters a new cycle.