Russia has signed a peace deal to end the conflict in Georgia but said "extra security measures" were needed before it withdraws.