Quantum-enhanced phase estimation in the presence of loss