All things being equal, a well-known and respected individual in your field who can write an excellent letter of recommendation for you is better than a person who is not nearly so well known who can write a similar letter.
However, you should not choose a famous name just to have that person write you a letter of recommendation if you are not actively interested in that person's research. The obvious reason for this is that hunting for a letter of a recommendation is likely not to work as well as doing a project you're truly interested in, because the motivation to work on it won't be nearly as strong.
As for topic, if possible, I would recommend picking a topic in the general area you wish to pursue as a PhD student. Note that it doesn't need to be the same topic—but if you want to do, for instance, theoretical CS, it's probably better to do a theoretical CS project than something more applied.