Qatar has formally condemned recent attacks on ships in the Gulf region, attributing the strikes to Iran and urging all parties to recommit.