One way to do it if you do not have a protractor to accurately measure the angle:
Lay a straight board along the top or bottom on your horizontal chair rail and extend it to the steps.(you can use a piece of the chair rail molding if need be). (Also, if working by yourself and you are sure the existing molding is parallel to the floor, you can lay it on the floor)
Run another against the wall laying on top of the steps so the two intersect or at least meet
Tape a piece of paper to the wall behind the intersection
Trace the top edge of both boards on the paper
Using a square (carpenters square, squared off piece of scrap, or anything that is a 90 degree angle) draw a line perpendicular to each top edge at the same distance back from the intersection on both boards. Its best if the distance back from the intersection is a least equal to the width of the molding.
Extend the perpendicular lines on the piece of paper until they intersect.
Using a straight edge, draw a line between this intersection and the one formed by the top edge of the boards. This is the angle line you want to cut.
This will split the angle exactly in half. If you cut or fold the paper on either of the lines from the top of the board and lay this against your miter saw fence, the last line drawn is what you set the miter angle of the blade to. If you are using a table saw, set the cut /folded edge against the miter guage and adjust it so the blade is parallel to the angle line.
When cutting, realize the angles will be opposite for each board, (ie, the angle will go to the left from the top edge on the right board and to the right from the top edge on the left board. In other words, the long end will be on the bottom after you cut it for the bottom of the stairs, and on the top edge for the top of the stairs.)
On a dual miter saw, you cut one board with the blade angled left and the other board with the blade angled right, keeping the same edge (either top or bottom) of the molding against the fence.
On the table saw, you will cut one board with the miter guage on the left of the blade and the other with the miter guage reset to the opposite angle and in the right miter slot.
Hope this is not too confusing. Best to try it with a couple of pieces of scrap first to get the angle perfect and to work out any confusion as to which way to set the boards against the fence or miter guage. Getting a nice fitting miter joint takes a little practice and patience, so try not to get into a hurry. Stairs are built by "rise" and "run" or "riser " and "tread" specs, and are built considering the structure of the building and to meet the local codes. Rarely will this result in a nice easily divided angle such as 30 degrees, 45 degrees, etc. Each set will be a little different, so splitting the angle that really exists is the key to getting it to look good.
Go