gold closes with a loss after iran nuclear deal