Any votes (up or down) are not calculated into reputation after a post is deleted:
- If a post was +2/-1 that is net 18 reputation. When deleted, the associated user will lose 18 reputation.
- If a post was +0/-3 that is net -6 reputation. When deleted, the associated user will gain 6 reputation.
All non-deleted posts are factored into the reputation calculation. This also includes downvoters - when an answer is deleted, any user who downvoted it would gain back 1 reputation.
If a deleted post is undeleted, then it will affect the reputation of all involved again.
With all that said, downvotes on deleted posts are still counted towards calculating a post ban. If a user has a history of posts that are not well-received (score of zero or lower) then the system automatically imposes a temporary ban. There are two separate ones: for questions and for answers. Deleting a downvoted post will not help with this. In fact, it might make things worse. The algorithm for imposing a ban is not known (to avoid gaming it) but in general, deleting content is received poorly. It is always better to attempt to improve a post.
For more information on post bans, see the FAQ entry: What can I do when getting "We are no longer accepting questions/answers from this account"?