There is no specific offence of standing on the footrests, it all comes down to a matter of opinion of the reporting officer if it got that far and the question that he would have to ask himself, “Did you maintain control” whilst you were standing up?
In most cases the answer would be quite simple and that would be “Yes” control was maintained and therefore you could not be reported for the offence of failing to maintain control of a motor vehicle.
However, if you stood up Rossi style (as he does after winning a GP) then it may give a different answer as both hands are off the bars and therefore to a degree the offence would become absolute.
Was your riding careless or dangerous as a result of standing up? This is a little bit more subjective as it would depend on what was happening at the time, speeds at which this was done, was anyone inconvenienced or was danger caused as a result of standing up?
To prove careless (and even dangerous driving although it is by degrees) it is for the prosecution to show that the standard of riding or driving fell well below the standard expected of a reasonably competent rider or driver, and therefore the act in itself of standing up would not constitute the offence but the circumstances and any subsequent incident.
So, the short answer is No it is not illegal, but there may be consequences of other offences having been commited, but the onus is on the prosecution to substantiate those offences.
So if you are travelling at low speed and you stand up to stretch your legs but maintain control throughout, then no offence has or can be committed.