Tehran says it has agreed to open the Strait of Hormuz for two weeks "if attacks against Iran are halted".