I use gdal_contour, part of the gdal package to generate contours from DEM data.
Edit: I use that on a Mac but I am pretty sure the GDAL libraries and utilities are available on Unix and Windows.