Nothing in the condition would preclude you being able to, but you would have disadvantage on any spell attack rolls.
restrained does only what it says it does, nothing more. Now, a specific effect that causes the condition may add additional detriments, one of which might be the inability to cast spells, but those would be in that effects description, and are not in the base condition
Can you cast spells while restrained?
"Sooner or later, your Players are going to smash your railroad into a sandbox."
-Vedexent
"real life is a super high CR."
-OboeLauren
"............anybody got any potatoes? We could drop a potato in each hole an' see which ones get viciously mauled by horrible monsters?"
-Ilyara Thundertale
Nothing in the condition would preclude you being able to, but you would have disadvantage on any spell attack rolls.
restrained does only what it says it does, nothing more. Now, a specific effect that causes the condition may add additional detriments, one of which might be the inability to cast spells, but those would be in that effects description, and are not in the base condition
As long as you have at least 1 hand that can make any somatic or material components.