The latest version of whatsapp has new privacy options that allow you to control the visibility of your "last seen", your status message and your profile photo - by either making them invisible or only showing those things to the people in your phones contacts. Restricting your "last seen" will also hide the fact that you online: it just remains blank.
In the whatsapp menu go to Settnigs > Account > Privacy. You need to have the latest version of whatsapp for ANDROID. I believe its also available for iOS, but cannot verify that.