For the most part, class rank does not significantly contribute to residency matching. However, like most things there are always exceptions - all else being equal (which they never are), someone at the top of his class at a well-regarded school will generally match better than someone who is at the bottom of his class at a lower tier school.
If you had to choose, spend more time worrying about getting honors in the clerkships in your chosen specialty and doing well on USMLE Step 1 than being the highest ranked in your class.