Iran has reportedly agreed to bar military vessels from the Strait of Hormuz under a deal brokered by Oman.