Gold retreats from $4,700 as profit-taking trims record rally