The US expects to end its operation in Iran in "weeks, not months", Secretary of State Marco Rubio says, after a meeting of G7 foreign ministers.