Hypothetically, if a person's pay period ends on Dec 31st 2012, and they get that paycheck the next week (as in, 2013), which year's contribution limit would any 401k contribution be applied toward?
Ask your company just to make sure. My experience has been that it is based on the date of the check, not the end of the pay period or the date the 401K deposit was made.
To verify this look at the stub for the paychecks at the end of 2012 and start of the new year, and compare them to your W2. The first check for 2013 will restart all your year-to-date totals.
I agree with mhoran_psprep's answer that it is the date of the paycheck that counts, not the end of the pay period. Some companies issue a special paycheck dated 31 December just to account for this, and especially if they contribute the "match amount" as a lump sum at the end of the year rather than on a ongoing basis for each pay period.