In the macro use:

/hud "Pet Hotbar" toggle

This will turn it either on or off. I use the hud and hotbar display commands to hide most of my UI without completely hiding the entire thing when doing anything I want less clutter for.