Naw -- not really illegal; although it's probably politically complicated to be religious: "No state organ, public organization or individual may compel citizens to believe in, or not to believe in, any religion; nor may they discriminate against citizens because they do, or do not believe in religion." (Article 45 of their 1978 Constitution).
Even today -- decades after the state/social pressures against religious affiliation disappeared -- most former soviet states still have very large atheist populations.