(Adds details throughout, background)

CARACAS, June 26 (Reuters) - Venezuela has signed an agreement with Iran for a $500 million credit line to fund joint investments and help improve supplies of goods "necessary for the Venezuelan people," President Nicolas Maduro said on Friday.

Declining oil prices have crimped Venezuela's cash-flow and aggravated shortages of consumer goods ranging from dish soap to milk, leaving Maduro's government seeking financing from allies around the world.

"We've signed (an agreement for) an open credit for $500 million that will begin to function immediately," Maduro said during a televised address following a meeting with an Iranian delegation.

Mohammad Reza Nematzadeh, Iran's Minister of Industry, Mines and Trade, said through a translator during a broadcast on state television that the agreement was preliminary and would be sent to Iran's finance ministry for review.

Venezuela's Information Ministry, which handles media requests on behalf of the Finance Ministry, did not immediately respond to an email seeking clarification on when the agreement would take effect.

The two OPEC countries have been allies since the era of late socialist leader Hugo Chavez, who was a vocal critic of U.S. sanctions against Iran and of its foreign policy toward Latin America.

Maduro says Venezuela is facing a Washington-backed "economic war" that he calls the cause of the country's soaring inflation and scarcity of consumer goods.

His adversaries say the problems are caused by a corruption-riddled currency control system, rigid price controls and a wave of nationalizations of private businesses.

(Reporting by Deisy Buitrago; Writing by Brian Ellsworth; Editing by Toni Reinhold) ((brian.ellsworth@thomsonreuters.com; 58 212 655 2660; Reuters Messaging: brian.ellsworth.thomsonreuters.com@reuters.net, @ReutersVzla))

Keywords: VENEZUELA IRAN/