You can try Database class to insert or update any contact or user record.
Insert using following code --
Database.SaveResult[] insertResult = Database.insert(<UserList/ContactList>, false);
Update using following code
Database.SaveResult[] unsertResult = Database.update(<UserList/ContactList>, false);
You can view errors using following code -
for(Database.SaveResult rs : insertResult/unsertResult){
if(!rs.isSuccess()){
Database.Error emsg=rs.getErrors()[0];
SYSTEM.DEBUG('--ERRORS--'+emsg);
}
}
This will help inseting or updating valid contact or user records.
Invalid record can be viewed using the resultset code given above.