Quantum algorithm for Wang-Landau sampling