Tanzanian lawmakers approved two laws that enable the government to renegotiate contracts with mining and energy companies as the state seeks a greater share of revenue from its natural resources.