Maybe he is bored and not tired as he does. My 8 yr old does the same thing from time to time and it's incredibly annoying to me.
Try bringing something with you that he doesn't usually get to have - a special book to read at the table, a coloring book w/crayons that he only gets when you go out to eat, a small puzzle, or a hand-held game that he can only play at restaurants.... and only if he isn't sprawled all over the place. If it's boredom, a reminder on the way to the restaurant of the toy/game that he gets if he sits nicely might help to prevent the behavior.
With my son, he's usually just bored or feels excluded because the adults tend to focus more on conversation with each other, so we make a special effort to converse with him and about topic he enjoys (though I'm pretty tired of talking about video games and skateboarding!!) just to make him feel like more of a part of the group and not there just because I am.
If it's not boredom, it could be some sort of attention-seeking game. I'm sure he's not consciously doing it, but make sure you are including him - I've always asked my son his opinion on where he wants to eat (though he doesn't have final say, he just has a vote) and also I let him pick his meal from two or three choices that I pre-select. He's getting plenty of attention, feels important (since he helps make decisions), and isn't restless or laying down or fidgety because he wants attention or is bored. Sometimes I slip and he starts the laying down thing, but usually a reminder "I guess you don't want to watch tv when we get home since you're so tired you can't even sit up now" usually fixes the problem.
good luck!