~と書いてあります。

Just as ~言う is used to show indirect speech, ~と書く is used to describe written text.

~と書いてあります is used to show that a certain text something is written somewhere.

あそこに「とまれ」と書いてあります。               
It says “stop” over there.