Gold prices retreated as the dollar recovered and optimism grew about a ceasefire between Russia and Ukraine.