could be the cold. Sometimes if you are cold, and have not been
moving your muscles for a long time, it will have contraction. Or
cover your legs watever with a blanket or what when you intend to
not move for some time.
should try stretching regularly - helps.