Best constant and extremals for a vector Poincaré inequality with weights