Believe it or not what you have described is known as "Restless legs syndrome". It can be a sign of any number of nutritional deficiencies - in particular Folic acid, Vitamin E, iron and magnesium have all been linked with rls.
I have posted a link to 2 articles below (from Townsend letters) giving further details - the first is on "restless legs syndrome" and the second on "nutritional factors and sleep".