The main purpose of your arms during the back squats is to keep the bar "locked" in place, and to promote a tight upper body in order to minimize energy leaks in the kinetic chain. Think of a car, if one of its tires are flat (leaking air) then it won't perform to its best. Similarly, if your upper torso is not tight, you will leak energy and therefore power, if your upper body is loose.
In terms of grip, look at a few powerlifters online and you will see that some of them grip the bar with their thumbs around the bar, and some of them without (called a false grip), this is really just preference and won't affect your lift much at all. I suggest going on YouTube and looking for Mark Rippetoe and his back squat video which has an entire 15 minute section on what your hands should be doing and what they help you achieve.
Basically, once you get under the bar, i.e the bar is resting on your traps, you want to pull your elbows back, almost like your doing a pullup, or that you're trying to "break the bar" over your back. This will ensure that you have a rigid torso that minimizes energy leaks and will ensure that the bar does not move during the squat at all, so you can focus more on the actual squat rather than the bar or fixing it.
Hope that helps.
As an additional note, I mean pull the bar down and break it over your back to clarify. I.e, the bar should already be resting on your upper back/ traps in the first place. Then you squeeze and pull it down and try to "break" it over your back. Generally, you would want to place the bar between the little "crease"/space that is naturally there between the top of your rear delts and your mid/lower traps...sort of like the bar is resting on a shelf, and all your doing is making sure the bar stays in that shell.