I have to agree...in beijing you will be closer to cultural spots. but actually in both cities you will live in a bubble and you should travel frequently to get a small glimpse at "real China" ...
also you should note that, if you also want to learn the language, the shanghainese dialect is very strong...beijing would hence be an easier choice!