World leaders have made historic commitments to renewable energy at a global summit.