Iran has shipped nearly 3 million barrels of oil from a storage site in China, people familiar with the matter said, in a bid to raise funds that could be used to shore up Iran’s allied militia groups in the Middle East.