What exactly got hacked? Your contact list? Or were you still a victim of email forwarding when using web-based email?
BTW, this seems to be rampant on Social Networks such as Facebook as well, hence receiving a "status" from someone on your "friend" list that asks you to click on a link or an app etc..
Next thing you know, your computer is infected.
(I'm not saying the two are related. I'm simply pointing out the "globality" of the problem)
FACT IS: These bottom-Dwellers who write the malware code get their "props" from within their circles for whatever damage they can cause. The more widespread the better (for them).
IF you have a web based email account AND you store your address book with the service (in the cloud), such as gmail, that data is reasonably safe by virtue of cloud storage/security.
BUT, it is possible that while you are accessing your email via your browser, that you could still be at risk IF, you have a virus/malware that is specific to email hijacking.
I recommend NOT leaving your browser open on your email page. Get your emails and LOG OFF.
This is good advice whether you are using a client or going web-based. When not in front of your 'puter, "sleep" it.
keep all of your anti-virus, and "cleaner" software up to date AND run it on a regular basis.. ALSO, remember to dump your internet history, passwords, cookies, etc..
Sadly, as quickly as malware holes are plugged, they are just as quick to write the next generation of garbage code to keep honest people frustrated and worried about their personal data.
For casual use I would also suggest that your email contact list only carry recipients' names and email info and nothing more. (ie., phone, address)