The Pacific island nation of Nauru has decided to establish diplomatic ties with Beijing, ending 20 years of relations with Taiwan.