Quantum coherence in a quantum heat engine