Thailand and Cambodia have reached a ceasefire after a week of fighting along a disputed border, officials say.