Women who gain either more or less weight than recommended during pregnancy may be more likely to have an overweight child, a new study has found.