Several oil producing nations such as Venezuela have sought in recent months to extract more revenue from foreign companies benefiting from high oil prices.
World oil prices reached $114 a barrel on Tuesday.
The law will provide Chavez, who has already nationalised part of the country's oil industry, with new funds to shore up popularity among the nation's poor majority, who have backed him for years but are increasingly critical of his government for food shortages and rampant crime.
The tax will apply to both international and national companies, including PDVSA, Venezuela's state oil company.
PDVSA took control of part of Venezuela's oil fields last year as part of the nationalisation programme, pushing out oil giants ExxonMobil and ConocoPhillips in the process.
Foreign oil companies can remain in Venezuela but only as minority partners in oil fields they once managed under contract.
American firm ExxonMobil has taken legal action against the Venezuelan government and sought court injunctions for up to $12bn in compensation, a move Chavez described as "legal terrorism" and threatened to retaliate by halting oil sales to the US.