Russian police detained 317 people on Saturday, including prominent opposition activists, around a political protest in Moscow which authorities had declared illegal.