Extremal principle of entropy production in the climate system