Need more info to diagnose. What is the power supply, startup/shutdown controller, motherboard and peripherals you are using?
Random reboots are often related to either heat issues (where is your computer and what is it enclosed in?) or voltage issues. ITPS can often disappoint, for example.
Do you have a USB hub in the mix? Is it powered or unpowered? Are all of the USB devices plugged in to the same port/hub? You mentioned that the touchscreen works. Is that plugged into the same place as the non-working devices?
I've experienced difficulty with my setup if I remove it from the car, then reinstall it and plug the hub into a different port. Everything must be reinstalled, including the keyboard and touchscreen....which you can't do if the keyboard and touchscreen aren't working!
Also, are you hibernating each time your shutdown or doing a full shutdown? There are cases of USB devices not working properly after awakening from hibernation.