A major ethnic rebel group and Myanmar's military government have signed a ceasefire agreement mediated by China, according to the Chinese foreign ministry.