Impact of optimal vaccination and social distancing on COVID-19 pandemic