If your computer had malware installed then yes, restoring from a backup without doing anything else would also restore the malware. What you'd want to do is back up the computer, determine what malware (if any) you have, and then remove it. The backup is insurance so that if you mess up the computer while removing the malware you can get back to where you were before you made the mess.
But Gary asks the important question. Why do you think you have malware? There's a program called EtreCheck (etrecheck.com) that was written by a prolific ASC helper that helps us see what's on your computer. Download it, run it, and paste the results here. Then we can give you a better answer.