Echo $noam shows the code, not the html result of the code...
First off, it shows the code, because that's what you are assigning to the variable $noam. You are enquoting the code. That assigns the string to your variable. What you want to do is to append each digit from $i as a string to the end of $noam.
Also, get rid of the call to echo $i;. This should be where you are adding the digit to your string...
How do I assign the <html><body>12345679</body></html> to the variable $noam?
You should really read the manual before asking questions like this. There are extensive online manuals and "how-to's" available everywhere on the web. Check www.phpfreaks.com for a stack of tutorials.
But to answer your question you simply do this...
$noam = "";
$i = 1;
while ($i < 10)
$i = $i + 1 ;
// The following line will add the value of $i to the end of the string $noam
$noam = $noam . $i;
// The following line will produce the result you wanted
$noam = "<html><body>".$noam."</body></html>";