Quarkonium physics in CMS