Two British nationals detained in Iran have been charged with espionage, Iranian Judiciary News Agency says.