Iran has condemned a Ukrainian attack on one of its commercial vessels.