What do you mean by a legend? That could mean something that labels each of several surfaces, but that wouldn't make a lot of sense for a contour plot. Or do you mean something that shows what the colors on a surface plot mean numerically?
You create a second surface plot for the legend using the minimum and maximum of your data and hide arguements on second plot. From an earlier post. Mathcad and PDF
You create a second surface plot for the legend using the minimum and maximum of your data and hide arguements on second plot. From an earlier post. Mathcad and PDF