The city council of a city of the metropolitan class shall have power by ordinance to contract with any competent party for the supplying and furnishing of electric light, electric heat or power, or other similar service for the use of the city on its streets and public places. Any such ordinance shall specify the rates, terms, and conditions upon which such service shall be supplied and furnished during the period named in the contract. Any such contract exceeding the term of forty years shall be void.