Mr. Morales nationalized Bolivia 's energy sector May 1 , and gave foreign energy companies 180 days to agree to new contracts with the state-owned firm .