Iran has detained the UK's deputy ambassador to Tehran and other foreigners on charges of spying, according to reports.