Don't panic, I'm sure many students do this and haven't even realised. With your details already on the paper it shouldn't be too an issue but if it is causing you stress best to contact your test centre or exam invigilator or if you are in school or further education college - ask your teacher/lecturer! Do it in the morning and hopefully they can ease your fears. It maybe that the papers haven't been sent off yet and could be signed post exam by the invigilator as witness you completed the paper or just sign your scribble for you! P.s it maybe you have signed it without even realising, it's nearly programmed into us we can often do it without thinking.