If my phone is lost and locked, how will someone know how to contact me?
While the phone is locked with a passcode, the only way someone could find the device's identity is to use a paperclip to remove the SIM tray. There the serial number and IMEI are printed on the tray. Also the ICCID (your SIM number) may be visible as well.

At that point, the finder could potentially reach out to Apple and/or your carrier that both presumably have some form of contact information to reach you - but your best bet is to send a message to the device with your contact information.

Unless you want to call your phone and hope someone answers. That also could place some contact information on the lock screen depending on your settings.