gold retreats as stocks extend gains