Ajax form submit not working, returns 0

The action: 'ajax_contact' part in:

var data = $form.serialize();
console.log(data);
$.ajax({
    url: ajax_contact.ajaxurl,
    dataType: 'json',
    action: 'ajax_contact',
    data: ajax_contact.data,

is most likely the cause here, that your ajax request is failing.

Move the action part into the data set instead.

Since you’re serializing the form data, you could try to add:

<input type="hidden" name="action" value="ajax_contact" />

into your form.

Also make sure the data attribute:

data: ajax_contact.data,

is getting the serialized data, but not the undefined ajax_contact.data.

You can try with manual json string instead for testing.

ps: also consider using nonce for extra security.