Competition and diversity determine vaccine impact on antibiotic resistance evolution