UN warns over impact of rapidly ageing populations