This would be a simple solution:
$(document).on('click', '#facebox a', function(evt) {
evt.preventDefault();
var userId = $(this).attr('href');
$('#user-id-input').attr('value', userId);
$(document).trigger('close.facebox');
});
Here is a working example: http://jsfiddle.net/j35J3/
But I wouldn't recommend to store the user Ids in the href attribute. If you use HTML 5 you could use a custom data attribute:
<a href="#" data-id="123">Name</a>
To access the id in the example:
var userId = $(this).data('id');