The Gauss-Bonnet theorem for cone manifolds and volumes of moduli spaces