I too have this rattle. It's pretty loud when lightly tapping or putting the phone on a desk. Anyway, after much research, I can confirm mine is the camera autofocus. A good way to test is this:
1) Open the camera app and focus on something in the distance.
2) Tap the back of the phone near the camera - rattles, right?
3) Hold the phone up pretty close to something and let it focus.
4) Tap the phone again - the rattle is gone/quieter?
That's the case for me anyway. I'd be keen to hear other peoples results from doing the above. If yours is different, it seems loose buttons can also cause a rattle.
The rattle doesn't sounds great, but it seems like it's normal. Some people don't have/can't hear the rattle - they're either not as OCD as me, or their autofocus is slightly tighter fitting. I guess it's all to do with manufacturing tolerances.
You can try your luck and try and get a replacement, but seems like it's 50/50 as to whether the phone will rattle. Plus, I'm sure us OCD folk will always find a problem - dead pixels, tinting, loose buttons.
Hope this helps anyway.
PS - I also took mine to the apple store at first, and was told it was the vibrate motor. I'm surprised how many people get told this. Seems that Apple could do the above test and reassure customers. Perhaps the vibrate motor is easier for people to understand. Also hear a lot of "it's the accelerometer/gyro/compass". This is nonsense, as these are solid state (microscopic) devices.
PPS - This also strikes me as something that could be solved by a firmware update. If you have it so the camera autofocus is set to maximum (as if it's focused on something close) while not in use, it wouldn't rattle. I guess it'd use more battery powering the autofocus (peizoelectric) constantly. Might be worth it to avoid thousands of people worrying about their rattling phones. Must cost Apple a fair bit in manpower and phone swaps though.