Agreed with Jlattimer. That is supported way..but I know you are looking in case contacts are more than 250 or so.
I have tried below query and it worked perfectly. I know MS does not recommend SQL window but sometimes it is necessary to execute these statements.
The simple way is:
Update contact set statecode=1,statuscode=2 where <Condition>
I think you should be aware that in case there is any other plugin or validations are there, it will not be executed when you deactivate the contacts by his way.
Thanks